package br.com.cqipac.dao;

// Generated 31/03/2008 01:38:36 by Hibernate Tools 3.2.1.GA

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import br.com.cqipac.to.Disposicao;
import br.com.cqipac.to.Funcionario;

/**
 * Home object for domain model class Disposicao.
 * 
 * @see br.com.cqipac.to.Disposicao
 * @author Hibernate Tools
 */
@Stateless
public class DisposicaoDao implements RemoteDao {

	private static final Log log = LogFactory.getLog(DisposicaoDao.class);

	@PersistenceContext
	private EntityManager entityManager;

	public void persist(Object transientInstance) throws Exception {
		log.debug("persisting Disposicao instance");

		entityManager.persist((Disposicao) transientInstance);
		log.debug("persist successful");

	}

	public void remove(Object persistentInstance) throws Exception {
		log.debug("removing Disposicao instance");

		entityManager.remove((Disposicao) persistentInstance);
		log.debug("remove successful");

	}

	public Disposicao merge(Object detachedInstance) throws Exception {
		log.debug("merging Disposicao instance");

		Disposicao result = entityManager.merge((Disposicao) detachedInstance);
		log.debug("merge successful");
		return result;

	}

	public Disposicao findById(Integer id) throws Exception {
		log.debug("getting Disposicao instance with id: " + id);

		Disposicao instance = entityManager.find(Disposicao.class, id);
		log.debug("get successful");
		return instance;

	}

	public List<Disposicao> list() throws Exception {

		log.debug("getting Disposicao instances list");

		List<Disposicao> instance = entityManager.createQuery(
				"from Disposicao disposicao").getResultList();
		log.debug("get successful");
		return instance;

	}

	@Override
	public Object find(Object searchingIsntance, Integer intTipoBusca) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Funcionario> list(Object searchingInstance,
			Integer intTipoBusca) {
		// TODO Auto-generated method stub
		return null;
	}
}
